package net.huashitong.ssydt.exam.entity.vo;

import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;

import javax.validation.constraints.NotNull;
import java.io.Serializable;
import java.util.List;

/**
 * @author <a href="mailto:yhy23456@163.com">huiyang.yu</a>
 * @since 2017.09.05
 */
@ApiModel(value = "PaperRecordInVO", description = "作答对象")
public class PaperRecordInVO implements Serializable {

    private static final long serialVersionUID = 1855417248505784835L;

    @ApiModelProperty(value = "试卷作答记录id", hidden = true)
    private Long paperRecordId;//试卷作答记录id

    @ApiModelProperty(value = "完成数")
    @NotNull(message = "完成数不能为空")
    private Integer finishNumber;//完成数

    @ApiModelProperty(value = "作答时间")
    @NotNull(message = "作答时间不能为空")
    private Integer userTime;//作答时间

    @ApiModelProperty(value = "选择题列表")
    @NotNull(message = "选择题列表不能为空")
    private List<PaperQuestionRecord> questions;

    public Long getPaperRecordId() {
        return paperRecordId;
    }

    public void setPaperRecordId(Long paperRecordId) {
        this.paperRecordId = paperRecordId;
    }

    public Integer getFinishNumber() {
        return finishNumber;
    }

    public void setFinishNumber(Integer finishNumber) {
        this.finishNumber = finishNumber;
    }

    public Integer getUserTime() {
        return userTime;
    }

    public void setUserTime(Integer userTime) {
        this.userTime = userTime;
    }

    public List<PaperQuestionRecord> getQuestions() {
        return questions;
    }

    public void setQuestions(List<PaperQuestionRecord> questions) {
        this.questions = questions;
    }

    @ApiModel(value = "PaperQuestionRecord", description = "选项对象")
    public static class PaperQuestionRecord implements Serializable {

        private static final long serialVersionUID = 3536468595716702447L;

        @ApiModelProperty(value = "选择题id")
        @NotNull(message = "选择题id不能为空")
        private Long questionId;//选择题id
        @ApiModelProperty(value = "顺序（序号）")
        @NotNull(message = "顺序（序号）不能为空")
        private Integer sequence;//序号
        @ApiModelProperty(value = "用户选择的序号列表")
        @NotNull(message = "用户选择的列表不能为空")
        private List<Integer> userAnswers;//用户选择的列表

        public Long getQuestionId() {
            return questionId;
        }

        public void setQuestionId(Long questionId) {
            this.questionId = questionId;
        }

        public List<Integer> getUserAnswers() {
            return userAnswers;
        }

        public void setUserAnswers(List<Integer> userAnswers) {
            this.userAnswers = userAnswers;
        }

        public Integer getSequence() {
            return sequence;
        }

        public void setSequence(Integer sequence) {
            this.sequence = sequence;
        }
    }

}
